package demo.xlj.yuyi.studentapp.common;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.ImageView;
import android.widget.RelativeLayout;
import android.widget.TextView;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;
import demo.xlj.yuyi.studentapp.R;
import demo.xlj.yuyi.studentapp.dudaoyuan.FaBuAnnouncementActivity;
import demo.xlj.yuyi.studentapp.utils.ActivityUtil;
import demo.xlj.yuyi.studentapp.utils.SharePerferencesUtils;

public class SendTongZhiChooseActivity extends AppCompatActivity {

    @BindView(R.id.ImageView_back)
    ImageView mImageViewBack;
    @BindView(R.id.TextView_Title)
    TextView mTextViewTitle;
    @BindView(R.id.RelativeLayout_Tong_Zhi_SheTuan)
    RelativeLayout mRelativeLayoutTongZhiSheTuan;
    @BindView(R.id.RelativeLayout_Tong_Zhi_Student)
    RelativeLayout mRelativeLayoutTongZhiStudent;

    private String uid;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_send_tong_zhi_choose);
        ButterKnife.bind(this);

        uid = (String) SharePerferencesUtils.get(SendTongZhiChooseActivity.this, "isWho", "99", 0);
        if (uid.equals("3")){
            mRelativeLayoutTongZhiStudent.setVisibility(View.GONE);
            mTextViewTitle.setText("发布社团通知");
        }else {
            mTextViewTitle.setText("请选择通知类型");
        }


    }

    @OnClick({R.id.ImageView_back, R.id.RelativeLayout_Tong_Zhi_SheTuan, R.id.RelativeLayout_Tong_Zhi_Student})
    public void onViewClicked(View view) {
        switch (view.getId()) {
            case R.id.ImageView_back:
                SendTongZhiChooseActivity.this.finish();
                break;
            case R.id.RelativeLayout_Tong_Zhi_SheTuan:
                //发布社团通知
                //1表示的是社团通知
                ActivityUtil.openActivityFromLeftToRightByResult(SendTongZhiChooseActivity.this, FaBuAnnouncementActivity.class,"type","1");
                break;
            case R.id.RelativeLayout_Tong_Zhi_Student:
                //发布学生会通知
                //2表示的是学生会通知
                ActivityUtil.openActivityFromLeftToRightByResult(SendTongZhiChooseActivity.this, FaBuAnnouncementActivity.class,"type","2");
                break;
        }
    }
}
